<template>
  <MLayout :arr="nameArr"></MLayout>
</template>

<script>
export default {
  computed: {
    nameArr() {
      const files = require.context("@/components/line/", true, /\.vue$/);
      let nameObj = {}
      let nameArr = []
      const reg = /[0-9]+/g
      files.keys().forEach((ele) => {
        const ctrl = files(ele).default || files(ele);
        const str = ctrl.name || ele.split("/")[ele.split("/").length - 2]
        const num = str.match(reg)
        nameObj[num] = str
      })
      for (const i in nameObj) {
        nameArr.push(nameObj[i])
      }
      return nameArr
    }
  }
}
</script>

<style scoped>

</style>
